<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
//写一个闭包 实现统计调用次数
function time(){
    var n=0;
    console.log(n);
    f2 =function(){
        n+=1;
        console.log ('执行了'+n+'次')
    };
    return f2
}

var a = time();
a();

a();
</script>
</body>
</html>